package com.twu.biblioteca;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 7/5/13
 * Time: 1:10 PM
 * To change this template use File | Settings | File Templates.
 */
public class MemberLogIn {

    public int checkLogIn(CustomerDetails[] customerDetails)
    {
        int i,flag=0;
        int customer_number=1;
        String username,customer_pwd;
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter your Username: ");
        username = scanner.next();
        System.out.print("Enter your password");
        customer_pwd = scanner.next();
        for (i=1;i<5;++i)
        {
            customer_number = customerDetails[i].LogIn(username,customer_pwd);
            if (customer_number != 0)
                break;

        }
        if (customer_number == 0){
            System.out.println("Incorrect Password!");
            System.exit(0);
        }
        else
        {
            return customer_number;
        }
        return 0;
    }
}
